package com.ruoyi.web.cp.domain.rm;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class RmobDoubleMerge {
    private Long id;
    private String gameId;
    private Date date;
    private String league;
    private String teamA;
    private String teamB;
    private JSONArray details;
    private String detailsJson; // 新增字段用于存储 JSON 字符串

    private RmResult rmResult;

    public String getDetailsJson() {
        return JSON.toJSONString(this.details);
    }

    public JSONArray getDetailsArray() {
        return JSON.parseArray(this.detailsJson);
    }

    public RmobDoubleMerge(String gameId, Date date, String league, String teamA, String teamB) {
        this.gameId = gameId;
        this.date = date;
        this.league = league;
        this.teamA = teamA;
        this.teamB = teamB;
        this.details = new JSONArray();
    }

    @Data
    public static class Detail {
        private String score;
        private String rm_plv;

        //波胆00赔率
        private String bdan00_plv;
        //双进赔率
        private String double_plv;
        //增加大小盘、独赢胜平负、亚盘盘口赔率属性
        private String goal_big_plv;
        private String goal_small_plv;
        private String goal_desc;

        //独赢胜平负
        private String win_plv;
        private String draw_plv;
        private String lose_plv;

        //亚盘赔率
        private String asian_big_plv;
        private String asian_small_plv;
        private String asian_desc;

        public Detail(String score, String rm_plv, String double_plv, String bdan00_plv, String goal_desc,
                      String goal_big_plv, String goal_small_plv, String win_plv, String draw_plv, String lose_plv,
                      String asian_desc, String asian_big_plv, String asian_small_plv) {
            this.score = score;
            this.rm_plv = rm_plv;
            this.bdan00_plv = bdan00_plv;
            this.double_plv = double_plv;
            this.goal_big_plv = goal_big_plv;
            this.goal_small_plv = goal_small_plv;
            this.goal_desc = goal_desc;
            this.win_plv = win_plv;
            this.draw_plv = draw_plv;
            this.lose_plv = lose_plv;
            this.asian_big_plv = asian_big_plv;
            this.asian_small_plv = asian_small_plv;
            this.asian_desc = asian_desc;
        }
    }
}